#ifndef PROCUTIL
#define PROCUTIL
#define numProcs 5

#include "SocketComm.h"
#include "Frame.h"
#include <vector>
#include <bitset>
using namespace std;

class ProcUtil
{
    private:
        bool waitForAck;
        int procAddr;
        vector<SocketComm> sockets;
        Frame lastSent;            
        bitset<numProcs> procsDone;
        
        SocketComm* route(Frame);
        Frame handleFrame(Frame);

    public:
        ProcUtil();
        ProcUtil(int);

        bool waitingForAck();
        void addSocket(SocketComm);
        Frame listen();
        void send(Frame);
        int getSocketEnd(int []);
        int getAddress();
        bool isDone();
        bool isDone(int);
        void setDone(int);
};
#endif
